package com.hnhs.model;

import com.hnhs.enums.ProdustStatus;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Product {
    private Integer id;
    private String pname;
    private String subname;
    private String imgurl;
    private Double oldprice;
    private Double newprice;
    private String color;
    private String size;
    private Integer count;
    private Integer status;
    private String description;
    private Integer category_id;
    private LocalDateTime createTime;

    private String statusX;

    public String getStatusX() {
        ProdustStatus produstStatus=ProdustStatus.findByCode(this.getStatus());
        if (produstStatus == null){
            return "";
        }
        return produstStatus.getMsg();
    }


}
